/*

Copyright Apple Computer, Inc. 1981-1988

Rez "{Boot}MacsBug:Resource Files:Templates.r" -o "{SystemFolder}MacsBug" -a ³³ "{Worksheet}"
Shutdown -r

*/

/*
  'mxwt' is a new resource type for templates. The only difference is a word count for the
   number of fields in a type. 'mxbt' used a byte count. 'mxbt' is still supported.
   However, you need the word count if you want to use ResEdit to create templates.
*/

type 'mxwt'{
	integer = $$CountOf(templates);					/* Number of templates               */
	array templates { pString;						/* Type name                         */
				      integer = $$CountOf(fields);  /* Number of fields in this template */
				      array fields { pString;	    /* Field name                        */
								     pString;       /* Field type                        */
								     integer;		/* Number of fields of this type     */
							       };
    			    };
};
	
resource 'mxwt' (100) {
	{

	/* Sample shows all possible types:
	"Sample", {
	 	"Byte",				"Byte",				1,
	 	"Signed Byte",		"SignedByte",		1,
	 	"Unsigned Byte",	"UnsignedByte",		1,
	 	"Align to word",	"Align",			1,
	 	"Word",				"Word",				1,
	 	"Signed Word",		"SignedWord",		1,
	 	"Unsigned Word",	"UnsignedWord",		1,
	 	"Long",				"Long",				1,
	 	"Signed Long",		"SignedLong",		1,
	 	"Unsigned Long",	"UnsignedLong",		1,
		"Boolean",			"Boolean",			1,
		"Padding",			"Skip",  			1,
		"Pascal string",	"pString",  		10,
		"C string",			"cString",  		1,
	 	"Align to word",	"Align",			1,
		"Text",				"Text",				4,
		"Handle",			"Handle",			1,
		"Next",				"^Sample",			1
		},
	*/

	"BitMap", {
	 	"baseAddr",			"Long",				1,
	 	"rowBytes",			"Word",				1,
	 	"bounds",			"Word",				4
		},

	"GrafPort", {
	 	"device",			"word",				1,
	 	"portBits",			"BitMap",			1,
	 	"portRect",			"Word",				4,
	 	"visRgn",			"Handle",			1,
	 	"clipRgn",			"Handle",			1,
	 	"bkPat",			"Byte",				8,
	 	"fillPat",			"Byte",				8,
	 	"pnLoc",			"Word",				2,
	 	"pnSize",			"Word",				2,
	 	"pnMode",			"Word",				1,
	 	"pnPat",			"Byte",				8,
	 	"pnVis",			"Word",				1,
	 	"txFont",			"Word",				1,
	 	"txFace",			"Word",				1,
	 	"txMode",			"Word",				1,
	 	"txSize",			"Word",				1,
	 	"",					"Skip",				4,
	 	"fgColor",			"Long",				1,
	 	"bkColor",			"Long",				1,
	 	"colrBit",			"Word",				1,
	 	"patStretch",		"Word",				1,
	 	"picSave",			"Handle",			1,
	 	"rgnSave",			"Handle",			1,
	 	"polySave",			"Handle",			1,
	 	"grafProcs",		"Long",				1
		},

	"WindowRecord", {
	 	"",					"Skip",				16,
	 	"portRect",			"Word",				4,
	 	"visRgn",			"Handle",			1,
	 	"clipRgn",			"Handle",			1,
	 	"",					"Skip",				76,
	 	"windowKind",		"Word",				1,
	 	"visible",			"Boolean",			1,
	 	"hilited",			"Boolean",			1,
	 	"goAwayFlag",		"Boolean",			1,
	 	"spareFlag",		"Boolean",			1,
	 	"strucRgn",			"Handle",			1,
	 	"contRgn",			"Handle",			1,
	 	"updateRgn",		"Handle",			1,
	 	"windowDefProc",	"Handle",			1,
	 	"dataHandle",		"Handle",			1,
	 	"titleHandle",		"^^PString",		1,
	 	"titleWidth",		"Word",				1,
	 	"controlList",		"Handle",			1,
	 	"nextWindow",		"^WindowRecord",	1,
	 	"windowPic",		"Handle",			1,
	 	"refCon",			"Long",				1
		},

	"TERec", {
	 	"destRect",			"Word",				4,
	 	"viewRect",			"Word",				4,
	 	"selRect",			"Word",				4,
	 	"lineHeight",		"Word",				1,
	 	"fontAscent",		"Word",				1,
	 	"selPoint",			"Word",				2,
	 	"selStart",			"Word",				1,
	 	"selEnd",			"Word",				1,
	 	"active",			"Word",				1,
	 	"wordBreak",		"Long",				1,
	 	"clikLoop",			"Long",				1,
	 	"clickTime",		"Long",				1,
	 	"clickLoc",			"Word",				1,
	 	"caretTime",		"Long",				1,
	 	"caretState",		"Word",				1,
	 	"just",				"Word",				1,
	 	"teLength",			"Word",				1,
	 	"hText",			"Handle",			1,
	 	"recalBack",		"Word",				1,
	 	"recalLines",		"Word",				1,
	 	"clikStuff",		"Word",				1,
	 	"crOnly",			"Word",				1,
	 	"txFont",			"Word",				1,
	 	"txFace",			"Byte",				1,
		"",					"Align",			1;
	 	"txMode",			"Word",				1,
	 	"txSize",			"Word",				1,
	 	"inPort",			"^GrafPort",		1,
	 	"highHook",			"Long",				1,
	 	"caretHook",		"Long",				1,
	 	"nLines",			"Word",				1,
		"lineStarts",		"Word",				20	/* Actually, there can be 16001 of these */
		},

	"IOPB", {
		"qLink",			"Long",				1,
		"qType",			"Word",				1,
		"ioTrap",			"Word",				1,
		"ioCmdAddr",		"Long",				1,
		"ioCompletion",		"Long",				1,
		"ioResult",			"Word",				1,
		"ioNamePtr",		"^PString",			1,
		"ioVRefNum",		"Word",				1,
		"ioRefNum",			"Word",				1,
		"ioVersNum",		"SignedByte",		1,
		"ioPermssn",		"SignedByte",		1,
		"ioMisc",			"Long",				1,
		"ioBuffer",			"Long",				1,
		"ioReqCount",		"Long",				1,
		"ioActCount",		"Long",				1,
		"ioPosMode",		"Word",				1,
		"ioPosOffset",		"Long",				1
		},

	"Zone", {
	 	"bkLim",			"Long",				1,
	 	"purgePtr",			"Long",				1,
	 	"hFstFree",			"Long",				1,
	 	"zcbFree",			"Long",				1,
	 	"gzProc",			"Long",				1,
	 	"moreMast",			"Word",				1,
	 	"flags",			"Word",				1,
	 	"",					"Skip",				16,	/* Unused count fields */
	 	"purgeProc",		"Long",				1,
	 	"sparePtr",			"Long",				1,
	 	"allocPtr",			"Long",				1
		},

	"VCB", {
		"qLink",			"Long",				1,
		"qType",			"Word",				1,
		"vcbFlags",			"Word",				1,
		"vcbSigWord",		"Word",				1,
		"vcbCrDate",		"Long",				1,
		"vcbLsBkUp",		"Long",				1,
		"vcbAtrb",			"Word",				1,
		"vcbNmFls",			"Word",				1,
		"vcbDirSt",			"Word",				1,
		"vcbBlLn",			"Word",				1,
		"vcbNmBlks",		"Word",				1,
		"vcbAlBlkSiz",		"Long",				1,
		"vcbClpSiz",		"Long",				1,
		"vcbAlBlSt",		"Word",				1,
		"vcbNxtFNum",		"Long",				1,
		"vcbFreeBks",		"Word",				1,
		"vcbVN",			"PString",			27,
		"",					"Align",			1,
		"vcbDrvNum",		"Word",				1,
		"vcbDRefNum",		"Word",				1,
		"vcbFSID",			"Word",				1,
		"vcbVRefNum",		"Word",				1,
		"vcbMAdr",			"Long",				1,
		"vcbBufAdr",		"Long",				1,
		"vcbMLen",			"Word",				1,
		"vcbDirIndex",		"Word",				1,
		"vcbDirBlk",		"Word",				1
		},

	"ControlRecord", {
		"nextControl",		"^^ControlRecord",	1,
		"contrlOwner",		"^WindowRecord",	1,
		"contrlRect",		"Word",				4,
		"contrlVis",		"Byte",				1,
		"contrlHilite",		"Byte",				1,
		"contrlValue",		"Word",				1,
		"contrlMin",		"Word",				1,
		"contrlMax",		"Word",				1,
		"contrlDefProc",	"Handle",			1,
		"contrlData",		"Handle",			1,
		"contrlAction",		"Long",				1,
		"contrlRfCon",		"Long",				1,
		"contrlTitle",		"PString",			0
		},

	"DialogRecord", {
		"window",			"WindowRecord",		1,
		"items",			"Handle",			1,
		"textH",			"^^TERec",			1,
		"editField",		"Word",				1,
		"editOpen",			"Word",				1,
		"aDefItem",			"Word",				1
		},
	
	"EventRecord", {
		"what",				"Word",				1,
		"message",			"Long",				1,
		"when",				"Long",				1,
		"where",			"Word",				2,
		"modifiers",		"Word",				1
		},
	
	"SFReply", {
		"good",				"Boolean",			1,
		"copy",				"Boolean",			1,
		"fType",			"Text",				4,
		"vRefNum",			"Word",				1,
		"version",			"Word",				1,
		"fName",			"PString",			0
		},

	"MenuInfo", {
		"menuID",			"Word",				1,
		"menuWidth",		"Word",				1,
		"menuHeight",		"Word",				1,
		"menuProc",			"Long",				1,
		"enableFlags",		"Long",				1,
		"menuData",			"PString",			0
		},

	"FontRec",	{
		"fontType",			"Word",				1,
		"firstChar",		"Word",				1,
		"lastChar",			"Word",				1,
		"widMax",			"Word",				1,
		"kernMax",			"SignedWord",		1,
		"nDescent",			"SignedWord",		1,
		"fRectWidth",		"Word",				1,
		"fRectHeight",		"Word",				1,
		"owTLoc",			"Word",				1,
		"ascent",			"Word",				1,
		"descent",			"Word",				1,
		"leading",			"Word",				1,
		"rowWords",			"Word",				1,
		"bitImage",			"Byte",				16,
		"bitImage",			"Byte",				16,
		"bitImage",			"Byte",				16,
		"bitImage",			"Byte",				16
		},

	 "ListRec", {
	 	"rview",			"Word",				4,
		"portPtr",			"Long",				1,
		"indent",			"Word",				2,
		"cellSize",			"Word",				2,
		"visible",			"Word",				4,
		"vScroll",			"Handle",			1,
		"hScroll",			"Handle",			1,
		"selFlags",			"Byte",				1,
		"lActive",			"Boolean",			1,
		"lReserved",		"Byte",				1,
		"listFlags",		"Byte",				1,
		"clikTime",			"Long",				1,
		"clikLoc",			"Word",				2,
		"mouseLoc",			"Word",				2,
		"lClikLoop",		"Long",				1,
		"lastClick",		"Word",				2,
		"refCon",			"Long",				1,
		"listDefProc",		"Handle",			1,
		"userHandle",		"Handle",			1,
		"dataBounds",		"Word",				4,
		"cells",			"Handle",			1,
		"maxIndex",			"Word",				1,
		"cellArray",		"Word",				16
		},

	 /* "DM A6+14 Stack" will display the parameters and locals on the stack */
	 "Stack", {
	 	"Param 1",			"Long",				1,
	 	"Param 2",			"Long",				1,
	 	"Param 3",			"Long",				1,
	 	"Param 4",			"Long",				1,
	 	"",					"Skip",				8,	/* Skip return address and A6 */
	 	"Local 1",			"Long",				1,
	 	"Local 2",			"Long",				1,
	 	"Local 3",			"Long",				1,
	 	"Local 4",			"Long",				1
		},
	},
};
